package com.yxy.springcloud.framework.unionauth.dao;

import com.yxy.springcloud.framework.common.base.MyMapper;
import com.yxy.springcloud.framework.unionauth.model.App;
import com.yxy.springcloud.framework.unionauth.model.Role;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface RoleMapper extends MyMapper<Role> {
  // 查看角色关联的app
  List<App> getAppListWithRole(Long roleId);

  // 删除过时的人role app对应关系
  void deleteAppRoleRelation(@Param("roleId") Long roleId, @Param("newAppIdList") String[] newAppIdList);

  //根据role name以及app code 查询role列表
  List<Role> getRoleWithRoleNameAndApp(@Param("appCode") String appCode, @Param("selectedRoleNameList") String[] selectedRoleNameList);
}
